#include "emfselector.h"

EmfSelector::EmfSelector()
{
    _color = QColor(0, 0, 0, 127);
}

void EmfSelector::draw(QPointF point, QVector<QPointF> &intesectionEmfPoints)
{
    glBegin(GL_LINES);
    glColor4f(_color.redF(), _color.greenF(), _color.blueF(), _color.alphaF());
    glVertex2d(point.x(), _viewport.top());
    glVertex2d(point.x(), _viewport.bottom());
    glEnd();


    glPointSize(POINTS_SIZE);
    glBegin(GL_POINTS);
    glColor4f(_color.redF(), _color.greenF(), _color.blueF(), _color.alphaF());
    for(int i=0; i<intesectionEmfPoints.size(); i++)
    {
        glVertex2d(intesectionEmfPoints[i].x(), intesectionEmfPoints[i].y());
    }
    glEnd();
}


void EmfSelector::setViewPort(QRectF viewport)
{
    _viewport = viewport;
}
